﻿@model List<etracks.Web.IssueReadOnlyViewModel>
@if (Model.Count > 0)
{
<table class="table table-hover table-striped">

    <thead>
        <tr>
            <th class="col-md-1">Id</th>
            <th class="col-md-3">Name</th>
            <th class="col-md-3">Project</th>
            <th class="col-md-5"></th>
        </tr>
    </thead>

    <tbody>

        @foreach (etracks.Web.IssueReadOnlyViewModel Issue in Model)
        {
            <tr>
                <td>
                    @Html.ActionLink(" ", "Edit", "Issue", new { id = Issue.Id }, new { @class = "glyphicon glyphicon-edit", style = "text-decoration:none;" })
                    @Issue.Id
                </td>
                <td>
                    @Html.ActionLink(Issue.Name, "View", "Issue", new { id = Issue.Id }, new { style="text-decoration:none" })
                </td>
                <td>
                    @if (DataHelper.IsNull(Issue.ProjectId.GetValueOrDefault()))
                    {
                        DataHelper.IfNull(Issue.ProjectId.GetValueOrDefault());
                    }
                    else
                    {
                        @*<p>[@Issue.ProjectId]</p>*@
                        @Issue.ProjectName
                        @*@Html.ActionLink(Issue.ProjectId.GetValueOrDefault().ToString(), "View", "Project", new { id = Issue.ProjectId.GetValueOrDefault() }, new { style = "text-decoration:none" })*@
                    }
                    
                </td>
                <td></td>
            </tr>
        }

    </tbody>

</table>
}
else
{
<p>There is no issue.</p>
}